package com.example.e_learn;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.e_learn.Entity.LearnContent;

public class LearnRecordFragment extends Fragment {
    //剩余单词数和错误单词的数量
    private TextView tvfaultcounts;
    private TextView tvremaincounts;
    //分数
    private TextView tvscore;
    //单词数和回答错误数的记录变量
//    private int size = WordList.size;
    private int faultcounts;
    //分数
    private int score = 0;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.learn_record_fragment,container,false);
        //注册控件
        tvfaultcounts = view.findViewById(R.id.fault_word_count);
        tvremaincounts = view.findViewById(R.id.remain_word_count);
        tvscore = view.findViewById(R.id.score_count);
        return view;

    }

    public void InfoInit () {
//        String faultcounts = String.valueOf(size);
//        tvfaultcounts.setText(faultcounts);
    }

    public void SetInfo(LearnContent content) {
        //错误单词个数的设置
        tvfaultcounts.setText(String.valueOf(content.getWordfaultcounts()));
        //分数的设置
        tvscore.setText(String.valueOf(content.getScore()));
    }
}
